package cn.project.domain.strategy.model.valobj;

import cn.project.domain.strategy.service.rule.filiter.factory.DefaultLogicFactory;
import cn.project.types.common.Constants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xu
 * @description 抽奖策略规则值对象
 * @date 2025/7/7
 */
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StrategyAwardRuleModelVO {
    private String ruleModels;
    public String[] raffleCenterRuleModelList(){
        List<String> ruleModelList = new ArrayList<>();
        String[] ruleModelsValues = ruleModels.split(Constants.SPLIT);
        for(String ruleModelValue : ruleModelsValues){
            if(DefaultLogicFactory.LogicModel.isCenter(ruleModelValue)){
                ruleModelList.add(ruleModelValue);
            }
        }
        return ruleModelList.toArray(new String[0]);
    }
}
